package com.nuc.zyt.day02.Enum;

/**
 * @ClassName Student
 * @Description TODO
 * @Author 耀酱
 * @Date 2023/5/16 12:42
 * @Version 1.0
 */

public class Student {
    private WeekDay weekDay;

    public void setWeekDay(WeekDay weekDay){
        this.weekDay = weekDay;
    }

    @Override
    public String toString() {
        return "weekday="+weekDay;
    }

    public static void main(String[] args) {
        Student student = new Student();
        student.setWeekDay(WeekDay.SATURDAY);

        System.out.println(student.weekDay);
        System.out.println(student);

        /**
         * 因为如果不作任何配置，MyBatis默认只能处理简单类型和常见的引用类型，
         * 比如String、Integer等，对于复杂类型（自定义类、枚举）会自动忽略：
         * 那么，如何处理POJO中复杂类型的字段呢？
         *
         * 通常来说我们会写一个转换器，不论存入还是取出，都要经过转换器：
         * ● 存入：从restDay中取出code存入数据库
         * ● 取出：根据code找到对应的WeekDay赋值给restDay
         *
         */

    }

}

